package com.ruoyi.common.sys.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.sys.entity.SysDictData;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 字典Mapper
 *
 * @author tanxingxian
 * @date 2021-12-27 11:18
 */
@Repository
public interface SysDictDataMapper extends BaseMapper<SysDictData> {

    /**
     * 根据字典类型获取字段数据列表
     */
    @Select("select dict_label as label, dict_value as value from sys_dict_data where " +
            "`status` = '0' and dict_type = #{dictType} order by dict_sort")
    List<Map<String, Object>> getDataList(@Param("dictType") String dictType);

}
